import { rcaNumberFormat,rcaNumberFormat0000 } from './common.js'
import { dateFormat } from '@/util/date'
import { commonTableOption } from './common.js'
export const tableOption = {
  ...commonTableOption,
  selection: true,
  page: false,
  emptyBtn: false,
  showSummary: false,
  height: '700px',
  column: [{
    type: 'date',
    label: '结算日期',
    prop: 'tradeDate',
    hide: true,
    search: true,
    searchValue: dateFormat(new Date(), 'yyyy-MM-dd'),
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    hide: true,
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    search: false,
    searchValue: '9',
    display: true,
    cascaderItem: ['stationCode'],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dictsecondnamecase',
  }, {
    label: '西安中铁票务收入日报表',
    children: [{
      type: 'select',
      label: '站点',
      prop: 'stationCode',
      props: {
        label: 'name',
        value: 'code'
      },
      dicFlag: false,
      dicUrl: `/support/swparamstation/dictvlinecode/{{key}}`,
      formatter: (row, value, label, column) => {
        if(value=='999999'){
          return '合计'
        }else{
          return value
        }
      },
    }, {
      label: '单程票',
      children: [{
        label: 'TVM发售/TVM+STM发售',
        children: [{
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '现金(TVM)',
          prop: 'tvmOneTicketCash'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝(TVM+STM)',
          prop: 'tvmOneTicketAlipay'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信(TVM+STM)',
          prop: 'tvmOneTicketWechat'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'X行(TVM+STM)',
          prop: 'tvmOneTicketBank'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'tvmSubTotal'
        },]
      }, {
        label: 'BOM票款',
        children: [{
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '现金',
          prop: 'bomOneTicketCash'
        },{
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'POS',
          prop: 'bomOnePosAmount'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝',
          prop: 'bomOneTicketAlipay'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'bomOneTicketWechat'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'bomSubTotal'
        },]
      },/* {
        type: 'input',
        showSummary: true,
        precision: 2,
		    width: "200px",
        formatter: (row, value, label, column) => {
          return rcaNumberFormat(value, true)
        },
        label: '预制票',
        prop: 'prefabricatedTicketAmount'
      },*/
	  {
        label: '预制票',
        children: [{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '现金',
          prop: 'prefabricatedTicketAmount'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'POS',
          prop: 'prefabricatedTicketPosAmount'
        }]
      }, {
        type: 'input',
        showSummary: true,
        precision: 2,
		    width: "200px",
        formatter: (row, value, label, column) => {
          return rcaNumberFormat(value, true)
        },
        label: '应急票',
        prop: 'emergencyTicketAmount'
      },]
    }, {
      label: '其他车票',
      children: [{
        type: 'input',
        showSummary: true,
        precision: 2,	
		    width: "200px",
        formatter: (row, value, label, column) => {
          return rcaNumberFormat(value, true)
        },
        label: '计次票',
        prop: 'ticketCounting'
      }, {
        label: '日票',
        children: [{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '现金',
          prop: 'dailyTicketCash'
        },{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'POS',
          prop: 'dailyTicketPosAmount'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝',
          prop: 'dailyTicketAlipay'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'dailyTicketWechat'
        },/*{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '长安通代售',
          prop: 'dailyTicketCat'
        }, */ {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'dailySubTotal'
        },

        ]
      }, {
        label: '纪念票',
        children: [{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '现金',
          prop: 'commemorativeTicketCash'
        },{
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'POS',
          prop: 'commemorativeTicketPosAmount'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
          width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝',
          prop: 'commemorativeTicketAlipay'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'commemorativeTicketWechat'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'commemorativeTicketSubTotal'
        },

        ]
      },

      ]
    },
    {
      label: 'APP纪念票(线上)',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'appCommemorativeTicket'
        },

      ]
    },

    {
      label: '长安通',
      children: [
        {
          label: '充值',
          children: [
            {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: '现金',
              prop: 'catTicketCash'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'POS',
              prop: 'catTicketPosAmount'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'BOM支付宝',
              prop: 'catTicketAlipay'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'BOM微信',
              prop: 'catTicketWechat'
            },/* {
              type: 'input',
              showSummary: true,
              precision: 2,
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: '长安通ITVM现金充值金额',
              prop: 'catTicketItvmCash'
            }, */{
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'TVM+STM支付宝',
              prop: 'catTicketItvmAlipay'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'TVM+STM微信',
              prop: 'catTicketItvmWechat'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: 'X行',
              prop: 'catTicketItvmBank'
            }, {
              type: 'input',
              showSummary: true,
              precision: 2,
			        width: "200px",
              formatter: (row, value, label, column) => {
                return rcaNumberFormat(value, true)
              },
              label: '小计',
              prop: 'catSubTotal'
            },

          ]
        },

        {
          type: 'input',
          showSummary: true,
          precision: 4,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0000(value, true)
          },
          label: '刷卡消费',
          prop: 'catTicketPayCard'
        },


      ]
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	  width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '网络售票',	  
      prop: 'onlineTicketSales'
    },
    {
      label: '电子二维码车票',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝',
          prop: 'qrCodeTicketAlipay'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'qrCodeTicketWechat'
        }, {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: 'APP银联支付',
          prop: 'qrCodeTicketUnionpay'
        },/*{
          type: 'input',
          showSummary: true,
          precision: 2,
		  width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '智码APP代售',
          prop: 'qrCodeTicketApp'
        },{
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信小程序（优惠）',
          prop: 'qrCodeTicketWechatappDiscount'
        },{
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信小程序',
          prop: 'qrCodeTicketWechatapp'
        }, */ {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'qrCodeSubTotal'
        },

      ]
    },
    {
      label: '人脸电子票',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '建行',
          prop: 'faceRecognitionTicketBank'
        },
      ]
    },
    {
      label: '应急及互联互通',
      children: [
        {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '支付宝',
          prop: 'qrConnectivityAlipay'
        },
         {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '微信',
          prop: 'qrConnectivityWechat'
        },
         {
          type: 'input',
          showSummary: true,
          precision: 2,
		      width: "200px",
          formatter: (row, value, label, column) => {
            return rcaNumberFormat(value, true)
          },
          label: '小计',
          prop: 'qrConnectivitySubTotal'
        }
      ]
    }, {
      type: 'input',
      showSummary: true,
      precision: 4,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat0000(value, true)
      },
      label: '交通一卡通',
      prop: 'allOneTrafficCard'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '车站票款现金长款',
      prop: 'stationTicketLongCash'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '车站票款现金短款',
      prop: 'stationTicketShortCash'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '补车站票款短款',
      prop: 'stationCompensation'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '备用金误解行',
      prop: 'releasePettyCash'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: 'POS小计',
      prop: 'subTotaPos'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '解行金额',
      prop: 'settlementAmount'
    }, {
      type: 'input',
      showSummary: true,
      precision: 4,
	    width: "200px",
      formatter: (row, value, label, column) => {
        return rcaNumberFormat0000(value, true)
      },
      label: '待清分合计',
      prop: 'subTota'
    },]
  }]
}
